
<!--新增-->
<div>
    <form class="form-horizontal" role="form">
        <div class="form-group">
            <label for="name" class="col-sm-2 control-label">名字</label>
            <div class="col-sm-8">
                <input type="text" class="form-control" id="name" placeholder="请输入名字" name="name" ng-model="user.name">
            </div>
        </div>
        <div class="form-group">
            <label for="age" class="col-sm-2 control-label">年龄</label>
            <div class="col-sm-8">
                <input type="text" class="form-control" id="age" placeholder="请输入年龄" name="age" ng-model="user.age">
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-8">
                <button ng-click="add()" class="btn btn-default">提交</button>
            </div>
        </div>
    </form>
</div>

<!--显示-->
<div class="panel panel-default">
    <div class="panel-heading">
        <h3 class="panel-title">信息提示</h3>
    </div>
    <div class="panel-body">
        <p ng-show="user.id">ID：<span ng-bind="user.id"></span></p>
        <p>名字：<span ng-bind="user.name"></span></p>
        <p>年龄：<span ng-bind="user.age"></span></p>
    </div>
</div>
<!--列表-->
<div class="table-responsive">
    <table class="table">
        <tr>
            <th>ID</th>
            <th>姓名</th>
            <th>年龄</th>
            <th>操作</th>
        </tr>
        <tr ng-repeat="user in users | orderBy:'-id'">
            <td>{{user.id}}</td>
            <td>{{user.name}}</td>
            <td>{{user.age}}</td>
            <td>
                <button class="btn btn-warning" ng-click="edit(user)" >修改</button>
                <button class="btn btn-danger" ng-click="delete(user)">删除</button>
            </td>
        </tr>
    </table>
</div>